home *** CD-ROM | disk | FTP | other *** search
- // config_dialog.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "divx4windows.h"
- #include "config_dialog.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // ConfigDialog dialog
-
-
- ConfigDialog::ConfigDialog(CWnd* pParent /*=NULL*/)
- : CDialog(ConfigDialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(ConfigDialog)
- m_bitrate = 0;
- m_rc_period = 0;
- m_max_quant = 0;
- m_min_quant = 0;
- m_search_range = _T("");
- //}}AFX_DATA_INIT
- }
-
-
- void ConfigDialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(ConfigDialog)
- DDX_Control(pDX, IDC_SLIDER_BITRATE, m_slider_bitrate);
- DDX_Text(pDX, IDC_BITRATE, m_bitrate);
- DDV_MinMaxLong(pDX, m_bitrate, 0, 6000);
- DDX_Text(pDX, IDC_RC_PERIOD, m_rc_period);
- DDX_Text(pDX, IDC_MAX_QUANT, m_max_quant);
- DDV_MinMaxInt(pDX, m_max_quant, 2, 31);
- DDX_Text(pDX, IDC_MIN_QUANT, m_min_quant);
- DDV_MinMaxInt(pDX, m_min_quant, 2, 31);
- DDX_CBString(pDX, IDC_SEARCH_RANGE, m_search_range);
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(ConfigDialog, CDialog)
- //{{AFX_MSG_MAP(ConfigDialog)
- ON_EN_CHANGE(IDC_BITRATE, OnChangeBitrate)
- ON_WM_HSCROLL()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // ConfigDialog message handlers
-
- BOOL ConfigDialog::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_slider_bitrate.SetRange(0, 6000, FALSE);
- m_slider_bitrate.SetPos(m_bitrate);
-
- UpdateData(FALSE);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- void ConfigDialog::OnChangeBitrate()
- {
- // When the edit box for bitrate is changed, update the slider.
- UpdateData(TRUE);
- m_slider_bitrate.SetPos(m_bitrate);
- UpdateData(FALSE);
- }
-
- void ConfigDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
- {
- // When the slider is changed, update the edit box.
- if ((CSliderCtrl*)pScrollBar == &m_slider_bitrate) {
- m_bitrate = m_slider_bitrate.GetPos();
- UpdateData(FALSE);
- return;
- }
-
- CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
- }
-